﻿//code by Heskey0
//https://space.bilibili.com/455965619
//https://github.com/Heskey0

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace Teresa
{
    

    /// <summary>
    /// 消息处理中心
    ///     只负责消息的转发
    ///     
    ///     ui -> msgCenter ->  other manager
    /// </summary>
    public class MsgCenter : EventBehaviour
    {
        public static MsgCenter Instance = null;

        void Awake()
        {
            Instance = this;

            // gameObject.AddComponent<AudioManager>();
            gameObject.AddComponent<UIManager>();
            // gameObject.AddComponent<SceneMgr>();

            DontDestroyOnLoad(gameObject);
        }


        public void SendMsg(Enum areaCode, Enum eventCode, object message)
        {
            switch (areaCode)
            {
                case AreaCode.UI:
                    //UIManager.Instance.ProcessMsg(eventCode, message);
                    break;

                case AreaCode.GAME:
                    break;

                case AreaCode.AUDIO:
                    break;

                case AreaCode.SCENE:
                    break;

                default:
                    Debug.Log("为定义事件码");
                    break;
            }
        }

    }
}